// File:    AtencionMedica.cs
// Author:  mespinozas
// Created: jueves, 10 de octubre de 2013 15:10:08
// Purpose: Definition of Class AtencionMedica

using System;

public class AtencionMedica
{
   public int idConsulta;
   public DateTime fechaConsulta;
   public decimal costoConsulta;
   public string tipoProcedimiento;
   
   public System.Collections.Generic.List<Enfermera> enfermeraAtencion;
   
   /// <summary>
   /// Property for collection of Enfermera
   /// </summary>
   /// <pdGenerated>Default opposite class collection property</pdGenerated>
   public System.Collections.Generic.List<Enfermera> EnfermeraAtencion
   {
      get
      {
         if (enfermeraAtencion == null)
            enfermeraAtencion = new System.Collections.Generic.List<Enfermera>();
         return enfermeraAtencion;
      }
      set
      {
         RemoveAllEnfermeraAtencion();
         if (value != null)
         {
            foreach (Enfermera oEnfermera in value)
               AddEnfermeraAtencion(oEnfermera);
         }
      }
   }
   
   /// <summary>
   /// Add a new Enfermera in the collection
   /// </summary>
   /// <pdGenerated>Default Add</pdGenerated>
   public void AddEnfermeraAtencion(Enfermera newEnfermera)
   {
      if (newEnfermera == null)
         return;
      if (this.enfermeraAtencion == null)
         this.enfermeraAtencion = new System.Collections.Generic.List<Enfermera>();
      if (!this.enfermeraAtencion.Contains(newEnfermera))
         this.enfermeraAtencion.Add(newEnfermera);
   }
   
   /// <summary>
   /// Remove an existing Enfermera from the collection
   /// </summary>
   /// <pdGenerated>Default Remove</pdGenerated>
   public void RemoveEnfermeraAtencion(Enfermera oldEnfermera)
   {
      if (oldEnfermera == null)
         return;
      if (this.enfermeraAtencion != null)
         if (this.enfermeraAtencion.Contains(oldEnfermera))
            this.enfermeraAtencion.Remove(oldEnfermera);
   }
   
   /// <summary>
   /// Remove all instances of Enfermera from the collection
   /// </summary>
   /// <pdGenerated>Default removeAll</pdGenerated>
   public void RemoveAllEnfermeraAtencion()
   {
      if (enfermeraAtencion != null)
         enfermeraAtencion.Clear();
   }
   public System.Collections.Generic.List<Medico> anestesista;
   
   /// <summary>
   /// Property for collection of Medico
   /// </summary>
   /// <pdGenerated>Default opposite class collection property</pdGenerated>
   public System.Collections.Generic.List<Medico> Anestesista
   {
      get
      {
         if (anestesista == null)
            anestesista = new System.Collections.Generic.List<Medico>();
         return anestesista;
      }
      set
      {
         RemoveAllAnestesista();
         if (value != null)
         {
            foreach (Medico oMedico in value)
               AddAnestesista(oMedico);
         }
      }
   }
   
   /// <summary>
   /// Add a new Medico in the collection
   /// </summary>
   /// <pdGenerated>Default Add</pdGenerated>
   public void AddAnestesista(Medico newMedico)
   {
      if (newMedico == null)
         return;
      if (this.anestesista == null)
         this.anestesista = new System.Collections.Generic.List<Medico>();
      if (!this.anestesista.Contains(newMedico))
      {
         this.anestesista.Add(newMedico);
         newMedico.AddAtencionDeAnestesista(this);      
      }
   }
   
   /// <summary>
   /// Remove an existing Medico from the collection
   /// </summary>
   /// <pdGenerated>Default Remove</pdGenerated>
   public void RemoveAnestesista(Medico oldMedico)
   {
      if (oldMedico == null)
         return;
      if (this.anestesista != null)
         if (this.anestesista.Contains(oldMedico))
         {
            this.anestesista.Remove(oldMedico);
            oldMedico.RemoveAtencionDeAnestesista(this);
         }
   }
   
   /// <summary>
   /// Remove all instances of Medico from the collection
   /// </summary>
   /// <pdGenerated>Default removeAll</pdGenerated>
   public void RemoveAllAnestesista()
   {
      if (anestesista != null)
      {
         System.Collections.ArrayList tmpAnestesista = new System.Collections.ArrayList();
         foreach (Medico oldMedico in anestesista)
            tmpAnestesista.Add(oldMedico);
         anestesista.Clear();
         foreach (Medico oldMedico in tmpAnestesista)
            oldMedico.RemoveAtencionDeAnestesista(this);
         tmpAnestesista.Clear();
      }
   }
   public System.Collections.Generic.List<Insumo> InsumosConsulta;
   public System.Collections.Generic.List<Enfermera> arsenalera;
   
   /// <summary>
   /// Property for collection of Enfermera
   /// </summary>
   /// <pdGenerated>Default opposite class collection property</pdGenerated>
   public System.Collections.Generic.List<Enfermera> Arsenalera
   {
      get
      {
         if (arsenalera == null)
            arsenalera = new System.Collections.Generic.List<Enfermera>();
         return arsenalera;
      }
      set
      {
         RemoveAllArsenalera();
         if (value != null)
         {
            foreach (Enfermera oEnfermera in value)
               AddArsenalera(oEnfermera);
         }
      }
   }
   
   /// <summary>
   /// Add a new Enfermera in the collection
   /// </summary>
   /// <pdGenerated>Default Add</pdGenerated>
   public void AddArsenalera(Enfermera newEnfermera)
   {
      if (newEnfermera == null)
         return;
      if (this.arsenalera == null)
         this.arsenalera = new System.Collections.Generic.List<Enfermera>();
      if (!this.arsenalera.Contains(newEnfermera))
      {
         this.arsenalera.Add(newEnfermera);
         newEnfermera.AddAtencionMedica(this);      
      }
   }
   
   /// <summary>
   /// Remove an existing Enfermera from the collection
   /// </summary>
   /// <pdGenerated>Default Remove</pdGenerated>
   public void RemoveArsenalera(Enfermera oldEnfermera)
   {
      if (oldEnfermera == null)
         return;
      if (this.arsenalera != null)
         if (this.arsenalera.Contains(oldEnfermera))
         {
            this.arsenalera.Remove(oldEnfermera);
            oldEnfermera.RemoveAtencionMedica(this);
         }
   }
   
   /// <summary>
   /// Remove all instances of Enfermera from the collection
   /// </summary>
   /// <pdGenerated>Default removeAll</pdGenerated>
   public void RemoveAllArsenalera()
   {
      if (arsenalera != null)
      {
         System.Collections.ArrayList tmpArsenalera = new System.Collections.ArrayList();
         foreach (Enfermera oldEnfermera in arsenalera)
            tmpArsenalera.Add(oldEnfermera);
         arsenalera.Clear();
         foreach (Enfermera oldEnfermera in tmpArsenalera)
            oldEnfermera.RemoveAtencionMedica(this);
         tmpArsenalera.Clear();
      }
   }

}